﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Diagnostics;
using Microsoft.VisualStudio.Modeling.Diagrams;

namespace DSLFactory.VSCTDesigner
{
    partial class CommandWithIconShape
    {
        protected override void InitializeShapeFields(IList<Microsoft.VisualStudio.Modeling.Diagrams.ShapeField> shapeFields)
        {
            base.InitializeShapeFields(shapeFields);

            ImageField imageField = null;
            foreach( ShapeField field in shapeFields )
            {
                if( field is ImageField )
                {
                    imageField = field as ImageField;
                    break;
                }
            }

            Debug.Assert(imageField != null);
            string name = imageField.Name;
            shapeFields.Remove(imageField);

            imageField = new DynamicImageField(name);
            shapeFields.Add(imageField);

        }

        public override bool HasShadow
        {
            get
            {
                return false;
            }
        }
    }
}
